import { _decorator, Component, Label, Node, Sprite, SpriteFrame } from 'cc';
import { BundleManager } from 'db://assets/Scripts/Framework/Managers/BundleManager';
const { ccclass, property } = _decorator;

@ccclass('WeaponItemUI')
export class WeaponItemUI extends Component {

    @property(Label)
    nameLabel: Label;

    @property(Sprite)
    weaponSprite: Sprite;

    @property(Sprite)
    rankSprite: Sprite;

    @property(Node)
    use: Node;

    @property([SpriteFrame])
    rankSfs: SpriteFrame[] = [];

    start() {

    }

    update(deltaTime: number) {

    }

    _Init(data: any) {
        this.nameLabel.string = data.name;
        BundleManager.GetBundle("MainPack").load(data.weaponSpriteFrame, SpriteFrame, (err, data) => { this.weaponSprite.spriteFrame = data });
    }

}


